import {  Request, Response } from 'express';

function queryGanttData(req: Request, res: Response, u: string)
{
    const data = {
        data: [
            { id: 1, text: 'mock #1', start_date: '15-04-2019 16:00', duration: 3, progress: 0.6 },
            { id: 2, text: 'mock #2', start_date: '18-04-2019 17:00', duration: 3, progress: 0.4 },
            { id: 3, text: 'mock #3', start_date: '18-04-2019 17:00', duration: 3, progress: 0.4 },
            { id: 4, text: 'mock #4', start_date: '18-04-2019 17:00', duration: 3, progress: 0.4 },
            { id: 5, text: 'mock #5', start_date: '18-04-2019 17:00', duration: 3, progress: 0.4 },
            { id: 6, text: 'mock #6', start_date: '18-04-2019 17:00', duration: 3, progress: 0.4 },
            { id: 7, text: 'mock #7', start_date: '18-04-2019 17:00', duration: 3, progress: 0.4,parent:2},
            { id: 8, text: 'mock #7', start_date: '18-04-2019 17:00', duration: 3, progress: 0.4,parent:1},
        ],
        links: [
            { id: 1, source: 1, target: 2, type: '0' },
            { id: 2, source: 3, target: 7, type: '0' },
            { id: 3, source: 4, target: 5, type: '0' },
        ]
    };
    return  res.json(data) ;
}

export default {
    'GET /api/queryGanttData': queryGanttData,
  };